Adding validation rules to a segment
Validation rules check that a set of data elements in a segment is present or absent in a document, according to the standard. For example, a rule can require at least one of several elements. You can add rules to X12, EDIFACT, and ODETTE profiles. Rules are applied to documents only when the profile's Segment Validation Rules option is on.
Prerequisites
- An EDI profile with a standard of X12, EDIFACT, or ODETTE.
- Segment Validation Rules selected on the Options tab. Rules are not applied to documents without it.
- The segment you want to validate.
Steps
-
Open the EDI profile and select the Data Elements tab.
-
Expand the tree and select the segment.
The segment details appear in the EDI Segment Details panel.
-
In the Validation Rules section, click Add Rule.
The Add/Edit Rule dialog opens.
-
Select the rule Type. The available types depend on the standard.
If you select a Conditional type, the Conditional Element list appears. Continue with step 5. Otherwise, go to step 6.
-
In the Conditional Element list, select the element whose presence or absence is evaluated first.
-
In the Elements list, select the check box for each element the rule evaluates. Use the search field to filter the list.
For types such as Paired/Multiple or All or None, select at least two elements. The rule has no effect with only one.
-
Click Save.
The rule appears in the Validation Rules table.
-
Optional. Repeat steps 3 to 7 to add more rules.
-
Click Save to save the profile.
Result
The rule appears in the segment's Validation Rules table. When the Segment Validation Rules option is on, the profile applies the rule to inbound documents received through a Trading Partner Start step, and to outbound documents sent through a Trading Partner step.